<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>IDA SDK: Functions: strings</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IDA SDK
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Header&#160;Files</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions: strings</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>functions that manipulate strings </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group___c_l_n_l__"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_l_n_l__.html">line cleanup flags</a></td></tr>
<tr class="memdesc:group___c_l_n_l__"><td class="mdescLeft">&#160;</td><td class="mdescRight">Passed as 'flags' parameter to <a class="el" href="group__str__funcs.html#ga1f87ab9445979e4ad6dc846b61d9980d" title="Performs some cleanup operations to a line. ">qcleanline()</a> <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__conv"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__conv.html">Functions: string conversion</a></td></tr>
<tr class="memdesc:group__conv"><td class="mdescLeft">&#160;</td><td class="mdescRight">functions that convert between string encodings <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structstrarray__t.html">strarray_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map strings to integer values - see <a class="el" href="group__str__funcs.html#gaa493732a206aee45f56adececa108f0b" title="Find a line with the specified code in the strarray_t array. ">strarray()</a>  <a href="structstrarray__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga5e3db055269b8392ac1535aa273a0511"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> char *<a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__str__funcs.html#ga5e3db055269b8392ac1535aa273a0511">add_spaces</a> (char *str, size_t bufsize, <a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> len)</td></tr>
<tr class="memdesc:ga5e3db055269b8392ac1535aa273a0511"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add space characters to the colored string so that its length will be at least 'len' characters.  <a href="#ga5e3db055269b8392ac1535aa273a0511">More...</a><br /></td></tr>
<tr class="separator:ga5e3db055269b8392ac1535aa273a0511"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa956e0ad9a61dbf6bd45ffc8bd4921a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> char *<a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__str__funcs.html#gaaa956e0ad9a61dbf6bd45ffc8bd4921a">trim</a> (char *str)</td></tr>
<tr class="memdesc:gaaa956e0ad9a61dbf6bd45ffc8bd4921a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove trailing space characters from a string.  <a href="#gaaa956e0ad9a61dbf6bd45ffc8bd4921a">More...</a><br /></td></tr>
<tr class="separator:gaaa956e0ad9a61dbf6bd45ffc8bd4921a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabaef2516798e95258629ab153166b4f3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> const char *<a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__str__funcs.html#gabaef2516798e95258629ab153166b4f3">skip_spaces</a> (const char *ptr)</td></tr>
<tr class="memdesc:gabaef2516798e95258629ab153166b4f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Skip whitespaces in the string.  <a href="#gabaef2516798e95258629ab153166b4f3">More...</a><br /></td></tr>
<tr class="separator:gabaef2516798e95258629ab153166b4f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8cebc57ea0896ff107b058f92b595cc1"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__str__funcs.html#ga8cebc57ea0896ff107b058f92b595cc1">skip_spaces</a> (char *ptr)</td></tr>
<tr class="separator:ga8cebc57ea0896ff107b058f92b595cc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f87ab9445979e4ad6dc846b61d9980d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> <a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__str__funcs.html#ga1f87ab9445979e4ad6dc846b61d9980d">qcleanline</a> (<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *buf, char cmt_char='\0', <a class="el" href="pro_8h.html#a1134b580f8da4de94ca6b1de4d37975e">uint32</a> flags=CLNL_TRIM|<a class="el" href="group___c_l_n_l__.html#ga2cccd6016c01267deed6bf132a84cd84">CLNL_FINDCMT</a>)</td></tr>
<tr class="memdesc:ga1f87ab9445979e4ad6dc846b61d9980d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs some cleanup operations to a line.  <a href="#ga1f87ab9445979e4ad6dc846b61d9980d">More...</a><br /></td></tr>
<tr class="separator:ga1f87ab9445979e4ad6dc846b61d9980d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa493732a206aee45f56adececa108f0b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> const char *<a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__str__funcs.html#gaa493732a206aee45f56adececa108f0b">strarray</a> (const <a class="el" href="structstrarray__t.html">strarray_t</a> *array, size_t array_size, int code)</td></tr>
<tr class="memdesc:gaa493732a206aee45f56adececa108f0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find a line with the specified code in the <a class="el" href="structstrarray__t.html" title="Map strings to integer values - see strarray() ">strarray_t</a> array.  <a href="#gaa493732a206aee45f56adececa108f0b">More...</a><br /></td></tr>
<tr class="separator:gaa493732a206aee45f56adececa108f0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae43c19f4536fdf26669afce4df5a8895"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae43c19f4536fdf26669afce4df5a8895"></a>
<a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> size_t <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__str__funcs.html#gae43c19f4536fdf26669afce4df5a8895">ea2str</a> (char *buf, size_t bufsize, <a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> ea)</td></tr>
<tr class="memdesc:gae43c19f4536fdf26669afce4df5a8895"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert linear address to UTF-8 string. <br /></td></tr>
<tr class="separator:gae43c19f4536fdf26669afce4df5a8895"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga5e3db055269b8392ac1535aa273a0511"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> char* <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> add_spaces </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bufsize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a>&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add space characters to the colored string so that its length will be at least 'len' characters. </p>
<p>Don't trim the string if it is longer than 'len'. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>pointer to colored string to modify (may not be NULL) </td></tr>
    <tr><td class="paramname">bufsize</td><td>size of the buffer with the string </td></tr>
    <tr><td class="paramname">len</td><td>the desired length of the string </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to the end of input string </dd></dl>

</div>
</div>
<a class="anchor" id="gaaa956e0ad9a61dbf6bd45ffc8bd4921a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> char* <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> trim </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove trailing space characters from a string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>pointer to string to modify (may be NULL) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to input string </dd></dl>

</div>
</div>
<a class="anchor" id="gabaef2516798e95258629ab153166b4f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> const char* <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> skip_spaces </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Skip whitespaces in the string. </p>
<dl class="section return"><dt>Returns</dt><dd>pointer to first non-whitespace char in given string </dd></dl>

</div>
</div>
<a class="anchor" id="ga8cebc57ea0896ff107b058f92b595cc1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">char* skip_spaces </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to first non-whitespace char in given string </dd></dl>

</div>
</div>
<a class="anchor" id="ga1f87ab9445979e4ad6dc846b61d9980d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> <a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> qcleanline </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>cmt_char</em> = <code>'\0'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="pro_8h.html#a1134b580f8da4de94ca6b1de4d37975e">uint32</a>&#160;</td>
          <td class="paramname"><em>flags</em> = <code>CLNL_TRIM|<a class="el" href="group___c_l_n_l__.html#ga2cccd6016c01267deed6bf132a84cd84">CLNL_FINDCMT</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs some cleanup operations to a line. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>string to modify </td></tr>
    <tr><td class="paramname">cmt_char</td><td>character that denotes the start of a comment:<ul>
<li>the entire text is removed if the line begins with this character (ignoring leading spaces)</li>
<li>all text after (and including) this character is removed if flag CLNL_FINDCMT is set </li>
</ul>
</td></tr>
    <tr><td class="paramname">flags</td><td>a combination of <a class="el" href="group___c_l_n_l__.html">line cleanup flags</a>. defaults to CLNL_TRIM </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>length of line </dd></dl>

</div>
</div>
<a class="anchor" id="gaa493732a206aee45f56adececa108f0b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#acb0b22a01885ebdb9ac572343bbc4dab">THREAD_SAFE</a> const char* <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> strarray </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structstrarray__t.html">strarray_t</a> *&#160;</td>
          <td class="paramname"><em>array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>array_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>code</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Find a line with the specified code in the <a class="el" href="structstrarray__t.html" title="Map strings to integer values - see strarray() ">strarray_t</a> array. </p>
<p>If the last element of the array has code==0 then it is considered as the default entry. <br />
If no default entry exists and the code is not found, <a class="el" href="group__str__funcs.html#gaa493732a206aee45f56adececa108f0b" title="Find a line with the specified code in the strarray_t array. ">strarray()</a> returns "". </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
